package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysBlackListMapper;
import com.ruoyi.system.domain.SysBlackList;
import com.ruoyi.system.service.ISysBlackListService;

/**
 * 用户黑名单Service业务层处理
 * 
 * @author yaohui
 * @date 2024-04-23
 */
@Service
public class SysBlackListServiceImpl implements ISysBlackListService 
{
    @Autowired
    private SysBlackListMapper sysBlackListMapper;

    /**
     * 查询用户黑名单
     * 
     * @param id 用户黑名单主键
     * @return 用户黑名单
     */
    @Override
    public SysBlackList selectSysBlackListById(Long id)
    {
        return sysBlackListMapper.selectSysBlackListById(id);
    }

    /**
     * 查询用户黑名单列表
     * 
     * @param sysBlackList 用户黑名单
     * @return 用户黑名单
     */
    @Override
    public List<SysBlackList> selectSysBlackListList(SysBlackList sysBlackList)
    {
        return sysBlackListMapper.selectSysBlackListList(sysBlackList);
    }

    /**
     * 新增用户黑名单
     * 
     * @param sysBlackList 用户黑名单
     * @return 结果
     */
    @Override
    public int insertSysBlackList(SysBlackList sysBlackList)
    {
        sysBlackList.setCreateTime(DateUtils.getNowDate());
        return sysBlackListMapper.insertSysBlackList(sysBlackList);
    }

    /**
     * 修改用户黑名单
     * 
     * @param sysBlackList 用户黑名单
     * @return 结果
     */
    @Override
    public int updateSysBlackList(SysBlackList sysBlackList)
    {
        sysBlackList.setUpdateTime(DateUtils.getNowDate());
        return sysBlackListMapper.updateSysBlackList(sysBlackList);
    }

    /**
     * 批量删除用户黑名单
     * 
     * @param ids 需要删除的用户黑名单主键
     * @return 结果
     */
    @Override
    public int deleteSysBlackListByIds(Long[] ids)
    {
        return sysBlackListMapper.deleteSysBlackListByIds(ids);
    }

    /**
     * 删除用户黑名单信息
     * 
     * @param id 用户黑名单主键
     * @return 结果
     */
    @Override
    public int deleteSysBlackListById(Long id)
    {
        return sysBlackListMapper.deleteSysBlackListById(id);
    }
}
